
package tests.library.util.resources;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.*;

import library.util.resources.*;

public class ZipResourcesLoaderTest
{
   ZipResourcesLoader zrl = new ZipResourcesLoader();

  public ZipResourcesLoaderTest() {
  }
  
  
  public void startTest() {
    String base_path = ".//";
    String path = base_path + "test.zip";
    zrl.setFileName(path);
    
    try {
     zrl.load();
     List listContent = zrl.getContent();
     ListIterator it = listContent.listIterator();
     
     while(it.hasNext()) {
       String name = (String)it.next();
       System.out.println("name: " + name);
       System.out.println("resource data: " + (new String(zrl.getResource(name))).toString());
     }
    }
    catch (NullPointerException e) {
      e.printStackTrace();
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch(IOException e) {
      e.printStackTrace();
    }
    
  }

  public static void main(String[] args) {
    ZipResourcesLoaderTest test = new ZipResourcesLoaderTest();
    test.startTest();	  
  } 
  
}